package org.seeplnframework.skyeye.common.model;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * @author ly
 * @date 2022/12/28
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class FeiShuAlertMessage extends WechatMessage implements Serializable {

    private static final long serialVersionUID = 1L;

    private static final String msg_type = "text";

    private Content content;

    private String targetHook;

    private boolean businessReminder;

    @Data
    public static class Content {

        private String text;
    }

    @Override
    public String toString() {
        JSONObject message = new JSONObject();
        message.put("text", this.content.getText());
        JSONObject body = new JSONObject();
        body.put("msg_type", msg_type);
        body.put("content", message);
        return JSONObject.toJSONString(body);
    }
}
